import 'package:json2dart_safe/json2dart.dart';
import 'dart:convert';

/// 注册业务实体
class UserRegister {
  String? username;
  String? password;
  String? confirmPassword;

  UserRegister({
    this.username,
    this.password,
    this.confirmPassword,
  });

  Map<String, dynamic> toJson() => {
        'username': username,
        'password': password,
        'confirmPassword': confirmPassword,
      };

  UserRegister.fromJson(Map json) {
    username = json.asString('username');
    password = json.asString('password');
    confirmPassword = json.asString('confirmPassword');
  }

  @override
  String toString() => jsonEncode(toJson());
}
